<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Frame timings: GDK 3 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GDK 3 Reference Manual">
<link rel="up" href="reference.html" title="API Reference">
<link rel="prev" href="GdkFrameClock.html" title="Frame clock">
<link rel="next" href="GdkDrawingContext.html" title="GdkDrawingContext">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#gdk3-GdkFrameTimings.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="reference.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GdkFrameClock.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GdkDrawingContext.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gdk3-GdkFrameTimings"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gdk3-GdkFrameTimings.top_of_page"></a>Frame timings</span></h2>
<p>Frame timings — Object holding timing information for a single frame</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="gdk3-GdkFrameTimings.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings"><span class="returnvalue">GdkFrameTimings</span></a> *
</td>
<td class="function_name">
<a class="link" href="gdk3-GdkFrameTimings.html#gdk-frame-timings-ref" title="gdk_frame_timings_ref ()">gdk_frame_timings_ref</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-GdkFrameTimings.html#gdk-frame-timings-unref" title="gdk_frame_timings_unref ()">gdk_frame_timings_unref</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gint64</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-GdkFrameTimings.html#gdk-frame-timings-get-frame-counter" title="gdk_frame_timings_get_frame_counter ()">gdk_frame_timings_get_frame_counter</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-GdkFrameTimings.html#gdk-frame-timings-get-complete" title="gdk_frame_timings_get_complete ()">gdk_frame_timings_get_complete</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gint64</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-GdkFrameTimings.html#gdk-frame-timings-get-frame-time" title="gdk_frame_timings_get_frame_time ()">gdk_frame_timings_get_frame_time</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gint64</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-GdkFrameTimings.html#gdk-frame-timings-get-presentation-time" title="gdk_frame_timings_get_presentation_time ()">gdk_frame_timings_get_presentation_time</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gint64</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-GdkFrameTimings.html#gdk-frame-timings-get-refresh-interval" title="gdk_frame_timings_get_refresh_interval ()">gdk_frame_timings_get_refresh_interval</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gint64</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-GdkFrameTimings.html#gdk-frame-timings-get-predicted-presentation-time" title="gdk_frame_timings_get_predicted_presentation_time ()">gdk_frame_timings_get_predicted_presentation_time</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gdk3-GdkFrameTimings.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody><tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings">GdkFrameTimings</a></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gdk3-GdkFrameTimings.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gdk/gdkwayland.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="gdk3-GdkFrameTimings.description"></a><h2>Description</h2>
<p>A <a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings"><span class="type">GdkFrameTimings</span></a> object holds timing information for a single frame
of the application’s displays. To retrieve <a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings"><span class="type">GdkFrameTimings</span></a> objects,
use <a class="link" href="GdkFrameClock.html#gdk-frame-clock-get-timings" title="gdk_frame_clock_get_timings ()"><code class="function">gdk_frame_clock_get_timings()</code></a> or <a class="link" href="GdkFrameClock.html#gdk-frame-clock-get-current-timings" title="gdk_frame_clock_get_current_timings ()"><code class="function">gdk_frame_clock_get_current_timings()</code></a>.
The information in <a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings"><span class="type">GdkFrameTimings</span></a> is useful for precise synchronization
of video with the event or audio streams, and for measuring
quality metrics for the application’s display, such as latency and jitter.</p>
</div>
<div class="refsect1">
<a name="gdk3-GdkFrameTimings.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gdk-frame-timings-ref"></a><h3>gdk_frame_timings_ref ()</h3>
<pre class="programlisting"><a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings"><span class="returnvalue">GdkFrameTimings</span></a> *
gdk_frame_timings_ref (<em class="parameter"><code><a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings"><span class="type">GdkFrameTimings</span></a> *timings</code></em>);</pre>
<p>Increases the reference count of <em class="parameter"><code>timings</code></em>
.</p>
<div class="refsect3">
<a name="gdk-frame-timings-ref.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>timings</p></td>
<td class="parameter_description"><p>a <a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings"><span class="type">GdkFrameTimings</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-frame-timings-ref.returns"></a><h4>Returns</h4>
<p> <em class="parameter"><code>timings</code></em>
</p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-8.html#api-index-3.8">3.8</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-frame-timings-unref"></a><h3>gdk_frame_timings_unref ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gdk_frame_timings_unref (<em class="parameter"><code><a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings"><span class="type">GdkFrameTimings</span></a> *timings</code></em>);</pre>
<p>Decreases the reference count of <em class="parameter"><code>timings</code></em>
. If <em class="parameter"><code>timings</code></em>

is no longer referenced, it will be freed.</p>
<div class="refsect3">
<a name="gdk-frame-timings-unref.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>timings</p></td>
<td class="parameter_description"><p>a <a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings"><span class="type">GdkFrameTimings</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-8.html#api-index-3.8">3.8</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-frame-timings-get-frame-counter"></a><h3>gdk_frame_timings_get_frame_counter ()</h3>
<pre class="programlisting"><span class="returnvalue">gint64</span>
gdk_frame_timings_get_frame_counter (<em class="parameter"><code><a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings"><span class="type">GdkFrameTimings</span></a> *timings</code></em>);</pre>
<p>Gets the frame counter value of the <a class="link" href="GdkFrameClock.html" title="Frame clock"><span class="type">GdkFrameClock</span></a> when this
this frame was drawn.</p>
<div class="refsect3">
<a name="gdk-frame-timings-get-frame-counter.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>timings</p></td>
<td class="parameter_description"><p>a <a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings"><span class="type">GdkFrameTimings</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-frame-timings-get-frame-counter.returns"></a><h4>Returns</h4>
<p> the frame counter value for this frame</p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-8.html#api-index-3.8">3.8</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-frame-timings-get-complete"></a><h3>gdk_frame_timings_get_complete ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_frame_timings_get_complete (<em class="parameter"><code><a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings"><span class="type">GdkFrameTimings</span></a> *timings</code></em>);</pre>
<p>The timing information in a <a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings"><span class="type">GdkFrameTimings</span></a> is filled in
incrementally as the frame as drawn and passed off to the
window system for processing and display to the user. The
accessor functions for <a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings"><span class="type">GdkFrameTimings</span></a> can return 0 to
indicate an unavailable value for two reasons: either because
the information is not yet available, or because it isn't
available at all. Once <a class="link" href="gdk3-GdkFrameTimings.html#gdk-frame-timings-get-complete" title="gdk_frame_timings_get_complete ()"><code class="function">gdk_frame_timings_get_complete()</code></a> returns
<code class="literal">TRUE</code> for a frame, you can be certain that no further values
will become available and be stored in the <a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings"><span class="type">GdkFrameTimings</span></a>.</p>
<div class="refsect3">
<a name="gdk-frame-timings-get-complete.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>timings</p></td>
<td class="parameter_description"><p>a <a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings"><span class="type">GdkFrameTimings</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-frame-timings-get-complete.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if all information that will be available
for the frame has been filled in.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-8.html#api-index-3.8">3.8</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-frame-timings-get-frame-time"></a><h3>gdk_frame_timings_get_frame_time ()</h3>
<pre class="programlisting"><span class="returnvalue">gint64</span>
gdk_frame_timings_get_frame_time (<em class="parameter"><code><a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings"><span class="type">GdkFrameTimings</span></a> *timings</code></em>);</pre>
<p>Returns the frame time for the frame. This is the time value
that is typically used to time animations for the frame. See
<a class="link" href="GdkFrameClock.html#gdk-frame-clock-get-frame-time" title="gdk_frame_clock_get_frame_time ()"><code class="function">gdk_frame_clock_get_frame_time()</code></a>.</p>
<div class="refsect3">
<a name="gdk-frame-timings-get-frame-time.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>timings</p></td>
<td class="parameter_description"><p>A <a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings"><span class="type">GdkFrameTimings</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-frame-timings-get-frame-time.returns"></a><h4>Returns</h4>
<p> the frame time for the frame, in the timescale
of <code class="function">g_get_monotonic_time()</code></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-frame-timings-get-presentation-time"></a><h3>gdk_frame_timings_get_presentation_time ()</h3>
<pre class="programlisting"><span class="returnvalue">gint64</span>
gdk_frame_timings_get_presentation_time
                               (<em class="parameter"><code><a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings"><span class="type">GdkFrameTimings</span></a> *timings</code></em>);</pre>
<p>Reurns the presentation time. This is the time at which the frame
became visible to the user.</p>
<div class="refsect3">
<a name="gdk-frame-timings-get-presentation-time.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>timings</p></td>
<td class="parameter_description"><p>a <a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings"><span class="type">GdkFrameTimings</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-frame-timings-get-presentation-time.returns"></a><h4>Returns</h4>
<p> the time the frame was displayed to the user, in the
timescale of <code class="function">g_get_monotonic_time()</code>, or 0 if no presentation
time is available. See <a class="link" href="gdk3-GdkFrameTimings.html#gdk-frame-timings-get-complete" title="gdk_frame_timings_get_complete ()"><code class="function">gdk_frame_timings_get_complete()</code></a></p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-8.html#api-index-3.8">3.8</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-frame-timings-get-refresh-interval"></a><h3>gdk_frame_timings_get_refresh_interval ()</h3>
<pre class="programlisting"><span class="returnvalue">gint64</span>
gdk_frame_timings_get_refresh_interval
                               (<em class="parameter"><code><a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings"><span class="type">GdkFrameTimings</span></a> *timings</code></em>);</pre>
<p>Gets the natural interval between presentation times for
the display that this frame was displayed on. Frame presentation
usually happens during the “vertical blanking interval”.</p>
<div class="refsect3">
<a name="gdk-frame-timings-get-refresh-interval.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>timings</p></td>
<td class="parameter_description"><p>a <a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings"><span class="type">GdkFrameTimings</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-frame-timings-get-refresh-interval.returns"></a><h4>Returns</h4>
<p> the refresh interval of the display, in microseconds,
or 0 if the refresh interval is not available.
See <a class="link" href="gdk3-GdkFrameTimings.html#gdk-frame-timings-get-complete" title="gdk_frame_timings_get_complete ()"><code class="function">gdk_frame_timings_get_complete()</code></a>.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-8.html#api-index-3.8">3.8</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-frame-timings-get-predicted-presentation-time"></a><h3>gdk_frame_timings_get_predicted_presentation_time ()</h3>
<pre class="programlisting"><span class="returnvalue">gint64</span>
gdk_frame_timings_get_predicted_presentation_time
                               (<em class="parameter"><code><a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings"><span class="type">GdkFrameTimings</span></a> *timings</code></em>);</pre>
<p>Gets the predicted time at which this frame will be displayed. Although
no predicted time may be available, if one is available, it will
be available while the frame is being generated, in contrast to
<a class="link" href="gdk3-GdkFrameTimings.html#gdk-frame-timings-get-presentation-time" title="gdk_frame_timings_get_presentation_time ()"><code class="function">gdk_frame_timings_get_presentation_time()</code></a>, which is only available
after the frame has been presented. In general, if you are simply
animating, you should use <a class="link" href="GdkFrameClock.html#gdk-frame-clock-get-frame-time" title="gdk_frame_clock_get_frame_time ()"><code class="function">gdk_frame_clock_get_frame_time()</code></a> rather
than this function, but this function is useful for applications
that want exact control over latency. For example, a movie player
may want this information for Audio/Video synchronization.</p>
<div class="refsect3">
<a name="gdk-frame-timings-get-predicted-presentation-time.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>timings</p></td>
<td class="parameter_description"><p>a <a class="link" href="gdk3-GdkFrameTimings.html#GdkFrameTimings" title="GdkFrameTimings"><span class="type">GdkFrameTimings</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-frame-timings-get-predicted-presentation-time.returns"></a><h4>Returns</h4>
<p> The predicted time at which the frame will be presented,
in the timescale of <code class="function">g_get_monotonic_time()</code>, or 0 if no predicted
presentation time is available.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-8.html#api-index-3.8">3.8</a></p>
</div>
</div>
<div class="refsect1">
<a name="gdk3-GdkFrameTimings.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GdkFrameTimings"></a><h3>GdkFrameTimings</h3>
<pre class="programlisting">typedef struct _GdkFrameTimings GdkFrameTimings;</pre>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>